<?php
class Manager_modules_model extends Admin_Model {
	//protected $module = 'manager_modules';

	public $table = ADMIN_MODULE_TABLE;
	function __construct(){
		// set field cần kiểm tra tên
		$this->checkExistField = array(
			'name','name_function'
		);
	}
	
	function check_modules($module){
		$this->db->select('id,name');
		$this->db->where('name_function',$module);
		$query = $this->db->get($this->table);

		if($query->result()){
			return $query->result();
		}else{
			return false;
		}
	}
	
	function list_module(){
		$this->db->select('*');
		$this->db->where($this->status_name,1);
		$this->db->order_by('name','ASC');
		$query = $this->db->get($this->table);

		if($query->result()){
			return $query->result();
		}else{
			return false;
		}
	}
}